#include <iostream>
#include <cmath>

long long n, t;

void add(long long x, long long & s0, long long & s1)
{
	for (int i = 0; x; i++, x /= 10) {
		if (i&1) s1 += x % 10;
		else     s0 += x & 10;
	}
}

long long bit_add(int x)
{
	long long sum = 0;
	for (; x; x /= 10) sum += x % 10;
	return sum;
}

int dec_len(long long x)
{
	if (!x) return 1;
	return std::log(x);
}

int main()
{
	std::ios::sync_with_stdio(false);
	for (int ti = 1; std::cin >> n >> t && !(n == -1 && t == -1); ti++) {
		std::cout << "Case #" << ti << ": ";
		long long s0 = 0, s1 = 0, sum = 0, prev = n;
		add(n, s0, s1);
		for (int i = 0; i < t; i++) {
			long long tmp = bit_add(prev) + sum;
			std::cout << "-->" << tmp << '\n';
			if (dec_len(tmp) & 1) add(tmp, s1, s0);
			else				  add(tmp, s0, s1);
			sum += tmp;
		}

		if (s1 % 11 == s0 % 11)
			std::cout << "Yes\n";
		else
			std::cout << "No\n";
	}
}
